package com.jetradarmobile.snowfall.sample.slice;

import com.jetradarmobile.snowfall.SnowfallView;
import com.jetradarmobile.snowfall.sample.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.colors.RgbColor;
import ohos.agp.components.element.ShapeElement;
import ohos.agp.utils.Color;
import ohos.agp.window.service.WindowManager;

public class MainAbilitySlice extends AbilitySlice {
    private static final int TWENTY = 47;
    private SnowfallView snowfallView;

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);
        snowfallView = (SnowfallView) findComponentById(ResourceTable.Id_snowfallview);
        ShapeElement shapeElement = new ShapeElement();
        shapeElement.setRgbColor(new RgbColor(TWENTY,TWENTY,TWENTY));
        snowfallView.setBackground(shapeElement);
        WindowManager.getInstance().getTopWindow().get().setStatusBarColor(Color.rgb(66, 119, 208));
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
